<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
        createElement() 创建节点
        createTextNode() 创建文本节点
        appendChild()   追加节点
     -->
    <div id="app">

    </div>
    <script>
        var app = document.getElementById("app")
        var p = document.createElement("p")
        var txt = document.createTextNode("hello world")
        p.appendChild(txt)
        console.log(p)
        app.appendChild(p)
        console.log(app)
    </script>
</body>
</html>